package com.kgc.service.impl;

import com.kgc.mapper.ProductMapper;
import com.kgc.pojo.Product;
import com.kgc.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public List<Product> selectProductList() {
        return productMapper.selectByExample(null);
    }

    @Override
    public Product selectProductById(Integer productId) {
        return productMapper.selectByPrimaryKey(productId);
    }

    @Override
    public Integer updateProductById(Product product) {
        return productMapper.updateByPrimaryKeySelective(product);
    }
}
